﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BaiTu.Framework;
using BaiTu.DTOS;

namespace BaiTu.IBLL
{
    /// <summary>
    /// 业务逻辑接口基类 泛型接口 保证泛型类必须继承自DTO基类 BaseDTO
    /// </summary>
    public interface IBaseBLL<T>
        where T : BaseDTO
    {
       
        /// <summary>
        /// 添加一个实体操作
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        InnerResult Add(T entity);

        /// <summary>
        /// 删除一个实体操作
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        InnerResult Delete(T entity);
        /// <summary>
        /// 更新一个实体操作
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        InnerResult Update(T entity);

        /// <summary>
        /// 通过编号获取实体对象
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        T FindByID(string id);
        /// <summary>
        /// 获取总个数
        /// </summary>
        /// <returns></returns>
        int GetCount();
        /// <summary>
        /// 获取总个数
        /// </summary>
        /// <returns></returns>
        long GetLongCount();
    }
}
